#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys
import json

sys.path.append(
    os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "qtrade")
)

import requests

# 测试
base_url = "http://localhost:8000/"

headers = {
}


def test_single_strategy():
    url = base_url + "trade"
    data = {"strategy": "single_macd"}
    res = requests.post(url, json=data)
    content = json.loads(res.content)
    print(content)

def test_double_strategy():
    url = base_url + "trade"
    data = {"strategy": "double_macd"}
    res = requests.post(url, json=data)
    content = json.loads(res.content)
    print(content)
